//
//  XRImmeLoginViewController.m
//  XDLookPic
//
//  Created by xiaorui on 14-4-22.
//  Copyright (c) 2014年 XD-XY. All rights reserved.
//

#import "XRImmeLoginViewController.h"

@interface XRImmeLoginViewController ()

@end

@implementation XRImmeLoginViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}
-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:YES];
    self.titleLabel.text =@"立即登录";

}
- (void)viewDidLoad
{
    [super viewDidLoad];
    
    UIImageView *logoImageView=[[UIImageView alloc]initWithFrame:CGRectMake(UI_SCREEN_WIDTH/2.0 -60, UI_TAB_BAR_HEIGHT +UI_STATUS_BAR_HEIGHT +30, 120, 120)];
    logoImageView.backgroundColor=[UIColor greenColor];
    [self.view addSubview:logoImageView];

    UIImageView *imageView=[[UIImageView alloc]initWithFrame:CGRectMake(35, VIEW_POINT_MAX_Y(logoImageView) +20, 30, 30)];
    imageView.backgroundColor=[UIColor redColor];
    [self.view addSubview:imageView];
    userNameField =creatXRTextField(@"请输入用户名", CGRectMake(VIEW_POINT_MAX_X(imageView),VIEW_POINT_MIN_Y(imageView) ,200,30));
    userNameField.delegate=self;
    [self.view addSubview:userNameField];
    
    UIImageView *passImageView=[[UIImageView alloc]initWithFrame:CGRectMake(35, VIEW_POINT_MAX_Y(userNameField), 30, 30)];
    [passImageView setBackgroundColor:[UIColor redColor]];
    [self.view addSubview:passImageView];
    passWordField =creatXRTextField(@"请输入密码", CGRectMake(VIEW_POINT_MAX_X(passImageView), VIEW_POINT_MAX_Y(userNameField), 200, 30));
    [self.view addSubview:passWordField];
    
    UIButton *bnt=creatXRButton(CGRectMake(UI_SCREEN_WIDTH/2.0 -40, UI_SCREEN_HEIGHT - 160, 80, 40),@"登  录",nil,nil);
    bnt.tag =UIBUTTON_TAG;
    [bnt addTarget:self action:@selector(loginButtonClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:bnt];
    UIButton *sineLoginBnt=creatXRButton(CGRectMake(10, UI_SCREEN_HEIGHT -140, UI_SCREEN_WIDTH/2.0 -15, 35), @"新浪微博登录",nil ,nil);
    sineLoginBnt.tag = UIBUTTON_TAG +5;
    [sineLoginBnt addTarget:self action:@selector(loginButtonClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.contentView addSubview:sineLoginBnt];
    UIButton *qqLoginBnt=creatXRButton(CGRectMake(UI_SCREEN_WIDTH/2.0 +5, UI_SCREEN_HEIGHT -140, UI_SCREEN_WIDTH/2.0 -15, 35), @"QQ账号登录",nil ,nil);
    qqLoginBnt.tag =UIBUTTON_TAG +10;
    [self.contentView addSubview:qqLoginBnt];
}

-(void)loginButtonClick:(UIButton *)button{
    if(button.tag == UIBUTTON_TAG){
    
    }else if (button.tag == UIBUTTON_TAG +5){
    
    }else{
        
    }
}
- (void)backPrePage
{
    DDLOG_CURRENT_METHOD;
    [self.navigationController popViewControllerAnimated:YES];
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
